#ifndef CTOPWIDGET_H
#define CTOPWIDGET_H

#include <QGridLayout>

#include "Native/CNativeWidget.h"

// Don't extend this class to non-window widget, use QWidget instead
class CTopWidget : public CNativeWidget {
    Q_OBJECT
public:
    explicit CTopWidget(QWidget *parent = nullptr);
    ~CTopWidget();

private:
    void init();

public:
    QWidget *widget() const;
    void setWidget(QWidget *widget);

protected:
    QWidget *m_widget;
    QVBoxLayout *m_layout;

protected:
    virtual void windowTitleChangeEvent(QEvent *event);

    bool event(QEvent *event) override;
};

#endif // CTOPWIDGET_H
